<!--
 * @Author: ChengNan 1429323234@qq.com
 * @Date: 2024-09-05 11:12:00
 * @LastEditors: ChengNan 1429323234@qq.com
 * @LastEditTime: 2024-09-05 13:11:21
 * @FilePath: /src/views/0.web-front/7天入门/8.背景渐变.html
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box1 {
      width: 500px;
      height: 100px;
      background-image: linear-gradient(red, yellow);
    }
    .box2 {
      width: 500px;
      height: 100px;
      background-image: linear-gradient(to right, red, yellow);
    }
    .box3 {
      width: 500px;
      height: 100px;
      background-image: linear-gradient(45deg, red, yellow);
    }
    .box4 {
      width: 500px;
      height: 100px;
      background-image: linear-gradient(12deg, red 40%, yellow 60%);
    }

    .box5 {
      width: 300px;
      height: 300px;
      background-image: radial-gradient(red, yellow, black);
      /* background-position: 100px 100px; */
      /* background-repeat: no-repeat; */
    }
    .box6 {
      width: 500px;
      height: 300px;
      background-image: radial-gradient(circle, red, yellow, black);
      /* background-image: radial-gradient(ellipse, red, yellow); */
    }
    .box7 {
      width: 500px;
      height: 300px;
      background-image: radial-gradient(farthest-side at 60% 5%, red, yellow, black);
    }
  </style>
</head>
<body>
  <div>
    <h1>线性渐变</h1>
    <div class="box1"></div>
    <br>
    <div class="box2"></div>
    <br>
    <div class="box3"></div>
    <br>
    <div class="box4"></div>
    <h1>径向渐变</h1>
    <div class="box5"></div>
    <br>
    <div class="box6"></div>
    <br>
    <div class="box7"></div>
  </div>
</body>
</html>